<div data-role="page" id="article<?php echo $structure->getFId() ?>">
    <script type="text/javascript">
        $(function() {
            $('#shareShareLink').live('click', function() {
                $("#addPlusPanel").toggle('fast', function() {

                });
            });
            $('#addFavourite').live('click', function() {
                $.ajax({
                    type : 'POST',
                    url : "/m/addFavourite",
                    dataType : 'json',
                    cache: false,
                    data: {
                        pageId : <?php echo $structure->getFId() ?>
                    },
                    success : function(data) {
                        alert("Add Favourite Successful.");
                    },
                    error : function(XMLHttpRequest, textStatus, errorThrown) {
                        alert("Your login attempt was not successful. Please try again.");
                    }
                });
            });
        });
    </script>

    <div id="header">
    	<img src="/uploads/<?php echo $headerLogo ?>" class="logo" height="52px"/>
        <a href="/m/navigation?articleId=<?php echo $structure->getFId() ?>" data-ajax="false" class="ui-btn-right"><img src="/images/mobile/btn_menu.png" class="menu" /></a>
    </div>

    <div data-role="content" style="padding: 0px;">
        <img src="/uploads/<?php echo $structure->getFImageDraft() ?>" />
        <div id="tu_content_text">
        <span class="page_title"><?php echo $structure->getFName() ?></span><br />
        <?php echo $structure->getFContentDraft() ?>
		</div>
        <div style="padding: 10px">
        <?php if ($structure->getChildrenLinkType() == "combo") {  ?>
            <style type="text/css">
                .ui-content .ui-listview {
                    margin: 0px;
                    margin-bottom: -15px;
                    margin-left: -15px;
                    margin-right: -15px;
                }
            </style>
            <script type="text/javascript">
                $(function() {
                    $('#selectLink').live('change', function() {
                        var link = $(this).val();
                        var articleId = $("#selectLink option:selected").attr("refId");
                        setTimeout(function(){
                            $("#enquiryForm").attr("action", link);
                            $("#articleId").val(articleId);
                            $("#enquiryForm").submit();
                        },500);
                    });
                });
            </script>
            <form action="forms-sample-response.php" id="enquiryForm" method="get" data-ajax="false">
                <input type="hidden" name="articleId" id="articleId">
                <select name="select-choice-11" id="selectLink" data-theme="a" data-icon="gear" data-inline="true" data-native-menu="false">
                    <option>Please select one</option>
                    <?php foreach ($tbl_structures as $tbl_structure):
                        $link = "/m/article?articleId=".$tbl_structure->getFId();
                        if ($tbl_structure->getExternalLink() == "Y")
                            $link = $tbl_structure->getFLink();
                    ?>
                        <option value="<?php echo $link ?>" refId="<?php echo $tbl_structure->getFId() ?>"><?php echo $tbl_structure->getFname() ?></option>
                    <?php endforeach; ?>
                </select>
            </form>
        <?php } else { ?>
            <ul data-role="listview" data-inset="true" data-theme="a">
            <?php foreach ($tbl_structures as $tbl_structure):
                $link = "/m/article?articleId=".$tbl_structure->getFId();
                if ($tbl_structure->getExternalLink() == "Y")
                    $link = $tbl_structure->getFLink();
            ?>
                <li><a href="<?php echo $link ?>"><?php echo $tbl_structure->getFname() ?></a></li>
            <?php endforeach; ?>
            </ul>
        <?php } ?>
        </div>
	</div>

    <div id="sharing" style="padding: 5px">
        <div id="shareFavorite" style="width:60px; float: left;padding: 4px">
            <a href="#" id="addFavourite" data-inline="true" data-rel="dialog" data-transition="pop" style="text-decoration: none; color: #808080;">
                <img src="/images/mobile/icon_favorite.png" /><br />
                Favorite</div>
            </a>
        <div id="shareShare" style="width:60px; float: left;padding: 4px">
            <a href="#" id="shareShareLink" data-inline="true" data-rel="dialog" data-transition="pop" style="text-decoration: none; color: #808080;">
                <img src="/images/mobile/icon_share.png" /><br />
                Share</div>
            </a>
        <div id="shareEmail" style="width:60px; float: left;padding: 4px">
            <a href="mailto:tuc@tuc.com" style="text-decoration: none; color: #808080;">
                <img src="/images/mobile/icon_email.png" /><br />&nbsp;Email
            </a>
        </div>
        <div class="clear"></div>
    </div>

    <div style="display: none;" id="addPlusPanel">
        <!-- AddThis Button BEGIN -->
        <div class="addthis_toolbox addthis_default_style ">
            <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
            <a class="addthis_button_tweet"></a>
            <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
            <a class="addthis_counter addthis_pill_style"></a>
        </div>
        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e75acce13c53e5f"></script>
    </div>

	<div id="footer_content" style="text-align: center;">
        <div class="footer_link">
            <?php
            $count = 0;
            foreach ($footer_menus as $tbl_structure):
                $link = "/m/article?articleId=".$tbl_structure->getFId();
                if ($tbl_structure->getExternalLink() == "Y")
                    $link = $tbl_structure->getFLink();

                $breakline = "";
                if ($count != 0)
                    $breakline = "<span style='color: #FFFFFF; font-family: Arial,Helvetica,sans-serif;font-size: 11px; font-weight: normal; text-shadow: 0 0px 0 #FFFFFF'>|</span>";
                $count++;
            ?>
                <?php echo $breakline; ?>
                <a href="<?php echo $link ?>" data-ajax="false" style="color: #FFFFFF; font-family: Arial,Helvetica,sans-serif;font-size: 11px; font-weight: normal; text-shadow: 0 0px 0 #FFFFFF"><?php echo $tbl_structure->getFName(); ?></a>
            <?php endforeach; ?>
        </div>
        <span class="footer_text" style="color: #FFFFFF; font-family: Arial,Helvetica,sans-serif;font-size: 11px; font-weight: normal; text-shadow: 0 0px 0 #FFFFFF">All Rights Reserved © 2012 Taylor's Education Group.</span>
    </div>
</div>